
cd "FILE PATH HERE"
use "rebels_data_replication", clear


****** Summary Statistics ******
*speeches
sum speeches
*hard topics
sum hard
sum hard_rate
*W.E. topics
sum war_topics
sum war_topics_rate
*gender
sum female
*participation in a rebel group
sum rebels
*government membership
sum gov
*ministerial appointments
sum minister
*Terms if office
sum years_in_office
* Independents
sum indep
*Women's seats
sum special
*Army representative
sum army_rep
* Rebel Leaders
sum rebel_leaders
* Chairperson
sum chair



****** Statistics for Women MPs ******
*** Zimbabwe 2008
* Women MPs
tab female if parliament == 2008 & year == 2008
* Rebels
tab female rebels if parliament == 2008 & year == 2008
* government rebels
tab female rebels if parliament == 2008 & year == 2008 & gov == 1
* women elected through quotas
tab special if parliament == 2008 & year == 2008
* chairmanships women
tab chair rebels if parliament == 2008 & female == 1
* ministerial posts women
tab minister rebels if parliament == 2008 & female == 1
* chairmanships men
tab chair rebels if parliament == 2008 & female == 0
* ministerial posts men
tab minister rebels if parliament == 2008 & female == 0





* Zimbabwe 2013
tab female if parliament == 2013 & year == 2013
* Rebels
tab female rebels if parliament == 2013 & year == 2013
* government rebels
tab female rebels if parliament == 2013 & year == 2013 & gov == 1
* women elected through quotas
tab special if parliament == 2013 & year == 2013
* chairmanships
tab chair rebels if parliament == 2013 & female == 1
* ministerial posts
tab minister rebels if parliament == 2013 & female == 1
* chairmanships men
tab chair rebels if parliament == 2013 & female == 0
* ministerial posts men
tab minister rebels if parliament == 2013 & female == 0



* Uganda 2011
tab female if parliament == 2011 & year == 2011
* Rebels
tab female rebels if parliament == 2011 & year == 2011
* government rebels
tab female rebels if parliament == 2011 & year == 2011 & gov == 1
* women elected through quotas
tab special if parliament == 2011 & year == 2011
* chairmanships
tab chair rebels if parliament == 2011 & female == 1
* ministerial posts
tab minister rebels if parliament == 2011 & female == 1
* chairmanships men
tab chair rebels if parliament == 2011 & female == 0
* ministerial posts men
tab minister rebels if parliament == 2011 & female == 0


* Uganda 2016
tab female if parliament == 2016 & year == 2016
* Rebels
tab female rebels if parliament == 2016 & year == 2016
* government rebels
tab female rebels if parliament == 2016 & year == 2016 & gov == 1
* women elected through quotas
tab special if parliament == 2016 & year == 2016
* chairmanships
tab chair rebels if parliament == 2016 & female == 1
* ministerial posts
tab minister rebels if parliament == 2016 & female == 1
* chairmanships men
tab chair rebels if parliament == 2016 & female == 0
* ministerial posts men
tab minister rebels if parliament == 2016 & female == 0




****** Descriptive Analysis ******
graph bar speeches if rebel_party==1, over(female) by(rebels, note("The sample is limited to MPs elected in rebel parties.")) graphregion(color(white)) bgcolor(white) blabel(bar, format(%4.2f)) intensity(25) ytitle("Number of Speeches") yscale(range(0 32))
* Figure 1
graph export "Graphs/h1_descriptives.tif", replace

graph bar hard if rebel_party==1, over(female) by(rebels, note("The sample is limited to MPs elected in rebel parties.")) graphregion(color(white)) bgcolor(white) blabel(bar, format(%4.2f)) intensity(25) ytitle("Number of Speeches on Hard Topics") yscale(range(0 18))
* Figure 2
graph export "Graphs/h2_descriptives.tif", replace

graph bar war_topics if rebel_party==1, over(female) by(rebels, note("The sample is limited to MPs elected in rebel parties.")) graphregion(color(white)) bgcolor(white) blabel(bar, format(%4.2f)) intensity(25) ytitle("Number of Speeches on W.E. Topics") yscale(range(0 0.4))
* Figure 3
graph export "Graphs/h3_descriptives.tif", replace


****** Main results ******
********************************************************************************
* create global macro with set of controls
global controls gov minister chair indep special army_rep years_in_office rebel_leaders i.ecountry spline*


****** Main Models ******
*** H1
eststo clear
eststo: zinb speeches i.rebels##i.female $controls, inflate(i.rebels##i.female $controls) cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)


* Figure 4
gr combine plot1 plot2 plot3, iscale(0.5) rows(1) graphregion(color(white)) title("")
graph export "Graphs/main_sims_H1.tif", replace





*** H2
eststo: zinb hard i.rebels##i.female $controls, inflate(i.rebels##i.female $controls) cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)



* as a rate
eststo: reg hard_rate i.rebels##i.female $controls, cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy (Ratio)") name("plot4", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels (Ratio)")  name("plot5", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders (Ratio)") name("plot6", replace)

*** Figure 5
gr combine plot1 plot2 plot3 plot4 plot5 plot6, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/main_sims_H2.tif", replace



*** H3
eststo: zinb war_topics i.rebels##i.female $controls, inflate(i.rebels##i.female $controls) cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)



* as a rate
eststo: reg war_topics_rate i.rebels##i.female $controls, cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy (Ratio)") name("plot4", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels (Ratio)")  name("plot5", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders (Ratio)") name("plot6", replace)

*** Figure 6
gr combine plot1 plot2 plot3 plot4 plot5 plot6, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/main_sims_H3.tif", replace




*** Table A3
esttab using Tables/main_results.tex, se bic star(* 0.05 ** 0.01) constant obslast label b(2) replace 





********************************************************************************
****** Robustness Check: only women MPs ******
eststo clear
* H1
eststo: zinb speeches i.rebels $controls if female == 1, inflate(i.rebels $controls) cluster(name) 

* H2
eststo: zinb hard i.rebels $controls if female == 1, inflate(i.rebels  $controls) cluster(name) 
eststo: reg hard_rate i.rebels $controls if female == 1, cluster(name) 


* H3
eststo: zinb war_topics i.rebels $controls if female == 1, inflate( i.rebels $controls) cluster(name) 
eststo: reg war_topics_rate i.rebels $controls if female == 1, cluster(name) 

* Table 4
esttab using Tables/women_only.tex, se bic star(* 0.05 ** 0.01) constant obslast label b(2) replace



********************************************************************************
****** Robustness Check: length of speeches ******
eststo clear
*** H1
eststo: zinb words i.rebels##i.female $controls, inflate(i.rebels##i.female $controls) cluster(name)

graph drop _all
* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy") name("plot1")

* Marginal effect 1 
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2")

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3")

*** Figure A1
gr combine plot1 plot2 plot3, iscale(0.5) rows(1) graphregion(color(white)) title("")
graph export "Graphs/words_sims_H1.tif", replace




*** H2
eststo: zinb hard_words i.rebels##i.female $controls, inflate(i.rebels##i.female $controls) cluster(name)

graph drop _all
* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy") name("plot1")

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2")

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3")


* as a rate
eststo: reg hard_words_rate i.rebels##i.female $controls, cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy (Ratio)") name("plot4")

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels (Ratio)")  name("plot5")

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders (Ratio)") name("plot6")

*** Figure A2
gr combine plot1 plot2 plot3 plot4 plot5 plot6, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/words_sims_H2.tif", replace



*** H3
eststo: zinb war_topics_words i.rebels##i.female $controls, inflate(i.rebels##i.female $controls) cluster(name)

graph drop _all
* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)


* as a rate
eststo: reg war_topics_rate_words i.rebels##i.female $controls, cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy (Ratio)") name("plot4", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels (Ratio)")  name("plot5", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders (Ratio)") name("plot6", replace)

*** Figure A3
gr combine plot1 plot2 plot3 plot4 plot5 plot6, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/words_sims_H3.tif", replace

* Table A5
esttab using Tables/words.tex, se bic star(* 0.05 ** 0.01) constant obslast label b(2) replace



******************************************************************************************
****** Robustness Check: Control for education + career path ******
eststo clear
*** H1
eststo: zinb speeches i.rebels##i.female $controls Education i.Career, inflate(i.rebels##i.female $controls Education i.Career) cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)


*** Figure A8
gr combine plot1 plot2 plot3, iscale(0.5) rows(1) graphregion(color(white)) title("")
graph export "Graphs/education_career_H1.tif", replace



*** H2
eststo: zinb hard i.rebels##i.female $controls Education i.Career, inflate(i.rebels##i.female $controls Education i.Career) cluster(name)

graph drop _all
* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)




* rate
eststo: reg hard_rate i.rebels##i.female $controls Education i.Career, cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy (Ratio)") name("plot4", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels (Ratio)")  name("plot5", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders (Ratio)") name("plot6", replace)

*** Figure A9
gr combine plot1 plot2 plot3 plot4 plot5 plot6, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/education_career_H2.tif", replace







*** H3
eststo: zinb war_topics i.rebels##i.female $controls Education i.Career, inflate(i.rebels##i.female $controls Education i.Career) cluster(name)

graph drop _all
* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy") name("plot1")

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2")

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3")

* rate
eststo: reg war_topics_rate i.rebels##i.female $controls Education i.Career, cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive Margins of Gender" "on Rebel Legacy (Ratio)") name("plot4")

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels (Ratio)")  name("plot5")

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders (Ratio)") name("plot6")

*** Figure A10
gr combine plot1 plot2 plot3 plot4 plot5 plot6, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/education_career_H3.tif", replace



* Table A8
esttab using Tables/education_career.tex, se bic star(* 0.05 ** 0.01) constant obslast label b(2) replace



******************************************************************************************
****** Robustness Check: years in office ******
eststo clear
*** H1
eststo: zinb speeches i.rebels##i.female##c.years_in_office $controls, inflate(i.rebels##i.female##c.years_in_office $controls) cluster(name)

graph drop _all
* Margins
margins, at (rebels = 0 years_in_office = (0(1)10) female = 1) at (rebels = 1 years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) level(95) xtitle("Years in Office") ytitle("") title("Predictive Margins of Time in the Legislature") plot(, label("Non Rebels" "Rebels")) name("plot1", replace)

* Marginal effect 1
margins, dydx(rebels) at (years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) yline(0) level(95) xtitle("Years in Office") ytitle("") title("First Differences of Time in the Legislature") name("plot2", replace)

*** Figure A11
gr combine plot1 plot2, iscale(0.5) rows(1) graphregion(color(white)) title("")
graph export "Graphs/years_results_H1.tif", replace




*** H2
eststo: zinb hard i.rebels##i.female##c.years_in_office $controls, inflate(i.rebels##i.female##c.years_in_office $controls) cluster(name)

graph drop _all
* Margins
margins, at (rebels = 0 years_in_office = (0(1)10) female = 1) at (rebels = 1 years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) level(95) xtitle("Years in Office") ytitle("") title("Predictive Margins of Time in the Legislature") plot(, label("Non Rebels" "Rebels")) name("plot1", replace)

* Marginal effect 1
margins, dydx(rebels) at (years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) yline(0) level(95) xtitle("Years in Office") ytitle("") title("First Differences of Time in the Legislature") name("plot2", replace)

* ratio
eststo: reg hard_rate i.rebels##i.female##c.years_in_office $controls ,cluster(name) 

* Margins
margins, at (rebels = 0 years_in_office = (0(1)10) female = 1) at (rebels = 1 years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) level(95) xtitle("Years in Office") ytitle("") title("Predictive Margins of Time in the Legislature (Ratio)") plot(, label("Non Rebels" "Rebels")) name("plot3")

* Marginal effect 1
margins, dydx(rebels) at (years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) yline(0) level(95) xtitle("Years in Office") ytitle("") title("First Differences of Time in the Legislature (Ratio)") name("plot4")



*** Figure A12
gr combine plot1 plot2 plot3 plot4, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/years_results_H2.tif", replace







*** H3
eststo: zinb war_topics i.rebels##i.female##c.years_in_office $controls, inflate(i.rebels##i.female##c.years_in_office $controls) cluster(name)

graph drop _all
* Margins
margins, at (rebels = 0 years_in_office = (0(1)10) female = 1) at (rebels = 1 years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) level(95) xtitle("Years in Office") ytitle("") title("Predictive Margins of Time in the Legislature") plot(, label("Non Rebels" "Rebels")) name("plot1", replace)

* Marginal effect 1
margins, dydx(rebels) at (years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) yline(0) level(95) xtitle("Years in Office") ytitle("") title("First Differences of Time in the Legislature") name("plot2", replace)

* ratio
eststo: reg war_topics_rate i.rebels##i.female##c.years_in_office $controls ,cluster(name) 

* Margins
margins, at (rebels = 0 years_in_office = (0(1)10) female = 1) at (rebels = 1 years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) level(95) xtitle("Years in Office") ytitle("") title("Predictive Margins of Time in the Legislature (Ratio)") plot(, label("Non Rebels" "Rebels")) name("plot3")

* Marginal effect 1
margins, dydx(rebels) at (years_in_office = (0(1)10) female = 1)
marginsplot, unique  graphregion(color(white)) bgcolor(white) yline(0) level(95) xtitle("Years in Office") ytitle("") title("First Differences of Time in the Legislature (Ratio)") name("plot4")



*** Figure A13
gr combine plot1 plot2 plot3 plot4, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/years_results_H3.tif", replace

* Table A9
esttab using Tables/years_sims.tex, se bic star(* 0.05 ** 0.01) constant obslast label b(2) replace








***************************************************************************************************
********************************************************************************
*** Robustness: Is this a party effect? Interaction between gender and government party
eststo clear
*** H1
eststo: zinb speeches i.rebel_party##i.female rebels minister chair indep special years_in_office i.ecountry spline*, inflate(i.rebel_party##i.female rebels minister chair indep special years_in_office i.ecountry spline*) cluster(name)

* Margins
margins female#rebel_party
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebel_party@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebel_party
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)

*** Figure A4
gr combine plot1 plot2 plot3, iscale(0.5) rows(1) graphregion(color(white)) title("")
graph export "Graphs/party_effect_H1.tif", replace


*** H2
eststo: zinb hard i.rebel_party##i.female rebels minister chair indep special years_in_office i.ecountry spline*, inflate(i.rebel_party##i.female rebels minister chair indep special years_in_office i.ecountry spline*) cluster(name)

* Margins
margins female#rebel_party
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebel_party@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebel_party
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)


* ratio
eststo: reg hard_rate i.rebel_party##i.female rebels minister chair indep special years_in_office i.ecountry spline*, cluster(name)

* Margins
margins female#rebel_party
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive margins of Gender" "on Rebel Legacy (Ratio)") name("plot4", replace)

* Marginal effect 1
margins r.rebel_party@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels (Ratio)")  name("plot5", replace)

* Marginal effect 2
margins r.female@rebel_party
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders (Ratio)") name("plot6", replace)

*** Figure A5
gr combine plot1 plot2 plot3 plot4 plot5 plot6, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/party_effect_H2.tif", replace



*** H3
eststo: zinb war_topics i.rebel_party##i.female rebels minister chair indep special years_in_office i.ecountry spline*, inflate(i.rebel_party##i.female rebels minister chair indep special years_in_office i.ecountry spline*) cluster(name)

* Margins
margins female#rebel_party
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebel_party@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebel_party
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)


* ratio
eststo: reg war_topics_rate i.rebel_party##i.female rebels minister chair indep special years_in_office i.ecountry spline*, cluster(name)

* Margins
margins female#rebel_party
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive margins of Gender" "on Rebel Legacy (Ratio)") name("plot4", replace)

* Marginal effect 1
margins r.rebel_party@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels (Ratio)")  name("plot5", replace)

* Marginal effect 2
margins r.female@rebel_party
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders (Ratio)") name("plot6", replace)

*** Figure A6
gr combine plot1 plot2 plot3 plot4 plot5 plot6, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/party_effect_H3.tif", replace

* Table A6
esttab using Tables/party_effect.tex, se bic star(* 0.05 ** 0.01) constant obslast label b(2) replace


***************************************************************************************************
* What about soft issues?
eststo clear
eststo: zinb soft i.rebels##i.female $controls, inflate(i.rebels##i.female $controls) cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive margins of Gender" "on Rebel Legacy") name("plot1", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels")  name("plot2", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders") name("plot3", replace)



* as a rate
eststo: reg soft_rate i.rebels##i.female $controls, cluster(name)

* Margins
margins female#rebels
marginsplot, horizontal unique recast(scatter) yscale(range(-1 2)) graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("Predictive margins of Gender" "on Rebel Legacy (Ratio)") name("plot4", replace)

* Marginal effect 1
margins r.rebels@female
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences Between" "Rebels and Non Rebels (Ratio)")  name("plot5", replace)

* Marginal effect 2
margins r.female@rebels
marginsplot, horizontal unique xline(0)  recast(scatter) yscale(range(-1 2))  graphregion(color(white)) bgcolor(white) aspectratio(1) level(95) ytitle("") title("First Differences" "Between Genders (Ratio)") name("plot6", replace)

*** Figure A14
gr combine plot1 plot2 plot3 plot4 plot5 plot6, iscale(0.5) graphregion(color(white)) title("")
graph export "Graphs/soft_speeches.tif", replace

* Table A10
esttab using Tables/soft.tex, se bic star(* 0.05 ** 0.01) constant obslast label b(2) replace





***************************************************************************************************
*** Education
ttest Education if female == 1, by(rebels)


*** Career
eststo clear
eststo: logit rebels i.Career female special army_rep i.ecountry spline*, cluster(name)

* Table A7
esttab using Tables/career_effect.tex, se bic star(* 0.05 ** 0.01) constant obslast label b(2) replace

margins i.Career, at (female == 1)
marginsplot, horizontal unique recast(scatter) xline(0) graphregion(color(white)) bgcolor(white) level(95) ytitle("") xtitle("Change in the probability of having a Rebel Legacy") title("")

* Figure A7
graph export "Graphs/career_effect.tif", replace


